<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DOM查询</title>
    <script>
       window.onload = function() {
        var div = document.querySelectorAll(".box1 div");
        console.log(div[1].innerHTML);
       }
    </script>
</head>
<body>
    <div class="box1">
        <div>aaa</div>
    </div>
    <div class="box1">
        <div>bbb</div>
    </div>
</body>
</html>